package com.forclass;

public class Book19Test {
    public static void main(String[] args) throws Exception {
//        Book19 b19 = new Book19();
//        System.out.println(b19.getClass().getName());
//        System.out.println(b19.getClass().getSimpleName());
//        System.out.println(b19.getClass().getTypeName());
//        b19.read();


//        通过Class.forName方式获取类对象实例
        Class<?> bookClazz = Class.forName("com.forclass.Book19");
        Object obj= bookClazz.getDeclaredConstructor().newInstance();
        Book19 b19  = (Book19) obj;
        b19.read();
    }

}
